<?php
class MyException extends Exception
{}

class QueryErrorException extends MyException
{
    public $query = '';

    public function __construct($query)
    {
        parent::__construct('Error query: ' . $query);
    }
}

class OutputResponseException extends MyException
{
    public $response = null;

    public function __construct(Response $response)
    {
        $this->response = $response;
    }
}

class RerouteException extends MyException
{
    public $router;

    public function __construct(Router $router)
    {
        $this->router = $router;

        parent::__construct('Reroute to: ' . $router->getRoute());
    }
}

class NotFoundException extends MyException
{
    public $route = '';

    public function __construct($route)
    {
        $this->route = $route;

        parent::__construct('Route not found: ' . $route);
    }
}

class ResponseException extends MyException
{
    public $controller = '';

    public $action = '';

    public function __construct($controller, $action)
    {
        parent::__construct('No returned output from ' . $controller . '::' . $action);
    }
}

class PermissionException extends MyException
{

}